package org.csmzxy233404;

public class example15 {
    public static void main(String[] args) {
        Animal2 animal2 = new Cat2();
        if (animal2 instanceof Dog2) {
            Dog2 dog2 = (Dog2) animal2;
            dog2.houseKeep();
        }else {
            System.out.println("对象类型向下转换不合法");
        }
    }
}